﻿using System;
using System.Collections.Generic;
using System.Linq;


namespace aula15
{
    class Program
    {
        static void Main(string[] args)
        {
            
            /* Exemplo 1
            List<int> ListaObjetos = new List<int>();
            ListaObjetos.AddRange(new int[] { 1, 3, 4, 12, 5, 5, 2, 8 });
            IEnumerable<int> subconjunto = from g in
                                               ListaObjetos
                                           where g > 3
                                           select g;
            foreach( int g in subconjunto)
            {
                Console.WriteLine(g);
            }*/
        
            
            
            
            /* Exemplo 2
            int[] numeros = new int[7] { 0, 1, 2, 3, 4, 5, 6 };

            var numQry =
                from num in numeros
                where (num % 2) == 0
                select num;

            foreach (int num in numQry)
            {
                Console.Write("{0}", num);
            }*/

            /* Exemplo 3 */
            int[] valores = new int[] { 10, 5, 13, 12, 9 };
            IEnumerable<int> qry =
                from valor in valores
                where valor > 9
                orderby valor descending
                select valor;
            foreach (var valor in qry)
                Console.WriteLine(valor);
            Console.Read();
        }
    }
}
